#include <iostream>

using namespace std;

const int N = 8e5 + 10;

int m, n;
string s, t;
int d[N];

int main()
{
	cin >> m >> t;
	s += ' ';
	for(auto ch : t)
	{
		s += '#';
		s += ch;
	}
	s += "##";
	n = s.size() - 2;
	
	int ret = 1;
	d[1] = 1;
	for(int i = 2, l = 1, r = 1; i <= n; i++)
	{
		int len = r >= i ? min(d[r - i + l], r - i + 1) : 1;
		while(s[i + len] == s[i - len]) len++;
		if(i + len - 1 > r) r = i + len - 1, l = i - len + 1;
		d[i] = len;
		
		if(i + d[i] - 1 == n) ret = max(ret, d[i] - 1);
	}
	
	cout << m - ret << endl;
	
	return 0;
}









